<template>
	<view class="bg-white p-l-sm p-r-m p-b" style="min-height: 1000px;">
		<view class="title text-center font-lg m-b p-t-sm">
			{{info.title}}
		</view>
		<view class="info m-b-sm text-gray font-sm text-center p-r">
			更新时间：{{info.updateTime|formatTime}}
		</view>
		<rich-text :nodes="info.content"></rich-text>
	</view>
</template>

<script>
	export default {
		components: {
		},
		data() {
			return {
				title: '',
				info: {
					content: '加载中...'
				}
			}
		},
		onLoad(options){
			this.title = options.title;
			this.loadData();
		},
		async onPullDownRefresh() {
			await this.loadData();
			uni.stopPullDownRefresh();
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 5000);
		},
		methods: {
			async loadData(){
				uni.showLoading({
					title: '加载中...'
				});
				let res = await this.util.request({
					url: '/v1/user_agreement/agreement/info',
					method: 'get',
					data: {
						title: this.title
					}
				});
				if (res.code == 200) {
					this.info = res.data.info;
				}
				uni.hideLoading();
			}
		}
	}
</script>

<style>

</style>
